import request from '@/utils/request'

// 组织树
export function deptTreeSelect(query) {
    return request({
        url: '/system/dept/treeselect',
        method: 'get',
        params: query
    })
}

// 新增
export function addDept(data) {
    return request({
        url: '/system/dept',
        method: 'post',
        data: data
    })
}

// 修改
export function updateDept(data) {
    return request({
        url: '/system/dept',
        method: 'put',
        data: data
    })
}

// 删除
export function delDept(id) {
    return request({
        url: '/system/dept/' + id,
        method: 'delete'
    })
}

//详情
export function getDept(id) {
    return request({
        url: '/system/dept/' + id,
        method: 'get'
    })
}




//new 
//查询
export function getNewDept(query) {
    return request({
        url: '/system/dept/list',
        method: 'get',
        params: query
    })
}

export function getNewDeptInfo(id) {
    return request({
        url: '/system/dept/' + id,
        method: 'get'
    })
}

//删除
export function deleteNewDept(id) {
    return request({
        url: '/system/dept/' + id,
        method: 'delete'
    })
}

//新增
export function addNewDept(data) {
    return request({
        url: '/system/dept',
        method: 'post',
        data: data
    })
}

export function updateNewDept(data) {
    return request({
        url: '/system/dept',
        method: 'put',
        data: data
    })
}

//导出
export function exportNewDept(query) {
    return request({
        url: '/system/dept/export',
        method: 'get',
        params: query
    })
}